﻿using System;

namespace Mbl.ParameterizedTest.AcceptanceTests.CalculatorTests
{
    internal static class IntFormatter
    {
        public static string ToFixedString(this int value, int maxDigits)
        {
            return value.ToString("D" + maxDigits);
        }

        public static string ToFixedNr(this int nr, int total)
        {
            var maxDigits = (int)Math.Ceiling(Math.Log10(total));
            return nr.ToFixedString(maxDigits);
        }
    }
}